/*
 * Created on May 15, 2005
 *
 */
package org.mushroomdb.query.impl.condition;

import org.mushroomdb.catalog.Column;
import org.mushroomdb.catalog.Register;

/**
 * @author Matias
 *
 */
public class GreatherOrEqualThanCondition extends EvaluationCondition {
	private GreatherThanCondition gratherThanCondition;
	private EqualsToCondition equalsToCondition;

	/**
	 * @param column
	 * @param value
	 */
	public GreatherOrEqualThanCondition(Column column, Object value) {
		super(column, value);
		this.gratherThanCondition = new GreatherThanCondition(column,value);
		this.equalsToCondition = new EqualsToCondition(column,value,true);
	}

	/**
	 * @see org.mushroomdb.query.impl.condition.EvaluationCondition#evaluate(com.mdlm.rdbms.catalog.Register)
	 */
	public boolean evaluate(Register register) {
		return this.gratherThanCondition.evaluate(register) || this.equalsToCondition.evaluate(register);
	}

	/**
	 * toString
	 */
	public String toString() {
		return this.getColumn().toString() + ">=" + this.getValue().toString(); //$NON-NLS-1$
	}
}
